#include <stdio.h>

void diamond(int x, char c);
int main(void)
{
	int x;
	char c;
	printf("Enter an odd number:");
	scanf("%d",&x);
	getchar();
	printf("Enter the character:");
	c = getchar();
	//printf("\n");
	diamond(x,c);
}

void output(int x, char c)
{
	int i =1;
	while(i <= x)
	{
		if(c == '\t')
			putchar(c);
		else
			printf("%c\t",c);
		i++;
	}
}
void diamond(int x, char c)
{
	if(!(x%2))
	{
		printf("The number must be odd!.\n");
		return;
	}
	for(int i = 1; i <= x; i++)
	{
		if(i <= x/2 +1)
		{
			output((x-2*i+1)/2, '\t');
			output(2*i-1, c);
			//output((x-2i+1)/2, '\t');
		}
		else if(i <=x)
		{
			output(i-(x+1)/2,'\t');
			output(2*x-2*i+1,c);
			//output(i-(x+1)/2,'\t');
		}
		printf("\n");
	}
	
}
